package at.sysarch.bean;

import java.beans.EventSetDescriptor;
import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;

import at.sysarch.utils.LinkEvent;
import at.sysarch.utils.LinkListener;

public class AbstractBeanInfo extends SimpleBeanInfo {

	public EventSetDescriptor[] getEventSetDescriptors() {
		try {
			EventSetDescriptor esd1;
			Class<FileLoad> c = FileLoad.class;
			String es = "link";
			Class<LinkListener> lc = LinkListener.class;
			String names[] = { "linkBean" };
			String al = "addLinkListener";
			String rl = "removeLinkListener";
			esd1 = new EventSetDescriptor(c, es, lc, names, al, rl);
			EventSetDescriptor esd[] = { esd1 };
			return esd;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return null;
	}

	public MethodDescriptor[] getMethodDescriptors() {
		try {
			Class<FileLoad> c = FileLoad.class;
			Class<?> parameterTypes[] = new Class[1];
			parameterTypes[0] = LinkEvent.class;
			String name = "linkBean";
			Method method1 = c.getMethod(name, parameterTypes);
			ParameterDescriptor pds[] = new ParameterDescriptor[1];
			pds[0] = new ParameterDescriptor();
			MethodDescriptor md1 = new MethodDescriptor(method1, pds);
			MethodDescriptor mds[] = { md1 };
			return mds;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return null;
	}
}